//a generic queue

#ifndef __GQUEUE_H
#define __GQUEUE_H

#include "utypes.h"
#include <stdio.h>
#include <stdlib.h>

// Generic Queue definition
typedef struct {
    void *ptr;		///< generic pointer for a queue
    int in;			///< index on array where to put next element
    int out;		///< index on array where to get next element from
    int cnt;		///< current number of elements in the queue
    int size;		///< queue capacity
	int ele_size;	///< size of the element to put in the queue
} GQueue;

/** Initialize the queue
*/
GQueue * newGQueue(int n_ele, int size_ele);

/** Delete the queue
*/
void deleteGQueue(GQueue *q);

/** Put ele in the queue pointed to by 'q'
* Returns false if operation failed (the queue is full)
*/
Bool putGQueue(GQueue *q, void *ele);

/** Get next element from queue
*  Returns -1 (an int) if there are no elements in the queue
*/
void * getGQueue(GQueue *q);

/** Returns true if the queue is empty
*/
Bool isEmptyGQueue(GQueue *q);

/** Returns true if the queue if full
*/
Bool isFullGQueue(GQueue *q);

#endif /* __GQUEUE_H */
